#pragma once

#include <string>
#include <vector>

#include "TreeNodeType.h"

class CFGNode;
using namespace std;

// A tree node consists of:
// 1. A TreeNodeType
// 2. A content that is the index of stmt or var
// 3. A list of pointers to its children
class TreeNode {
	private:
		TreeNodeType mTreeNodeType;
		int mContent;
		vector<TreeNode*> mChildrenList;
		TreeNode* mParent;
		//CFGNode* mCFGNode;
	public:
		TreeNode(void);
		TreeNode(TreeNodeType);
		TreeNode(TreeNodeType, int);
		~TreeNode(void);

		void setNodeType(TreeNodeType);
		TreeNodeType getNodeType();

		void setContent(int);
		int getContent();

		/*bool setCFGNode(CFGNode*);
		CFGNode* getCFGNode();*/
		void addChild(TreeNode*);
		void addChildFront(TreeNode*);
		void removeChildAtIndex(int index);
		vector<TreeNode*> getChild();
		int getNumberOfChildren();

		void addParent(TreeNode*);
		TreeNode* getParent();
};

